import { http } from '@/tool/utils'
import { iPb } from '@/protobuf/interface'

export function ListAdminRole(data: iPb.Admin.IListAdminRoleRequest):Promise<iPb.Admin.IListAdminRoleResponse> {
    return http.post("ListAdminRole",iPb.Admin.ListAdminRoleRequest.toObject(iPb.Admin.ListAdminRoleRequest.create(data)))
}

export function CreateAdminRole(data: iPb.IDbAdminRole):Promise<iPb.Admin.ICreateAdminRoleResponse> {
    return http.post("CreateAdminRole",iPb.DbAdminRole.toObject(iPb.DbAdminRole.create(data)))
}

export function UpdateAdminRole(data: iPb.IDbAdminRole):Promise<iPb.Admin.IUpdateAdminRoleResponse> {
    return http.post("UpdateAdminRole",iPb.DbAdminRole.toObject(iPb.DbAdminRole.create(data)))
}

export function ReadAdminRole(formData: iPb.Admin.IReadAdminRoleRequest):Promise<iPb.IDbAdminRole> {
    return http.post("ReadAdminRole",iPb.Admin.ReadAdminRoleRequest.toObject(iPb.Admin.ReadAdminRoleRequest.create(formData)))
}

export function DeleteAdminRole(formData: iPb.Admin.IDeleteAdminRoleRequest):Promise<iPb.Admin.IDeleteAdminRoleResponse> {
    return http.post("DeleteAdminRole",iPb.Admin.DeleteAdminRoleRequest.toObject(iPb.Admin.DeleteAdminRoleRequest.create(formData)))
}